package com.multi.thread.chapter03.demo13;

import java.io.PipedReader;
import java.io.PipedWriter;

public class Run {
	
	public static void main(String[] args) throws Exception {
		WriteData writeData = new WriteData();
		ReadData readData = new ReadData();
		
		PipedReader input = new PipedReader();
		PipedWriter out = new PipedWriter();
		
		input.connect(out);
		
		ThreadRead threadRead = new ThreadRead(readData, input);
		threadRead.start();
		
		Thread.sleep(2000);
		
		ThreadWrite threadWrite = new ThreadWrite(writeData, out);
		threadWrite.start();
	}

}
